export function throttle(fn, delay=300) {
  let time = null; //利用了闭包，因为下面引用了time，所以他还没被销毁
  return function () {
    if (time) {
      clearTimeout(time)
    }
    let that = this
    time = setTimeout(function () {
      fn.apply(that)
    }, delay)
  }
}